require 'watir'
include Watir
require 'test/unit'
require 'test/unit/ui/console/testrunner'
require 'watir/testUnitAddons'
require 'watir/testcase'
require 'watir/contrib/enabled_popup'
class TC_Downloads < Test::Unit::TestCase
  def test_04
    photo_destination = 'http://telligent.com/Themes/Telligent/images/placeholder2.gif'
    $ie.goto($UniVar)
    $ie.refresh()
    $ie.refresh()
    
    $ie.link(:text, 'Downloads').click
    $ie.image(:index, 21).click
    $ie.image(:index, 26).click
    $ie.link(:text, 'Upload').click
    $ie.wait()
    $ie.link(:text, 'Specify File/URL').click
    $ie.frame(:index, 2).radio(:index, 2).set
    $ie.frame(:index, 2).text_field(:index, 1).set(photo_destination)
    $ie.frame(:index, 2).link(:text, 'Save').flash
    $ie.frame(:index, 2).link(:text, 'Save').click
    $ie.text_field(:index, 2).value = "Telligent Logo"
    $ie.button(:caption, 'Save').click
    $ie.link(:text, 'Telligent Logo').click
    
    assert($ie.contains_text('File Details'))

    $ie.link(:text, 'Downloads').click
    assert($ie.link(:text, 'Telligent Logo').exists?)
    $ie.link(:text, 'Telligent Logo').click
    $ie.link(:text, 'Delete').click
    $ie.button(:caption, 'Delete').click
  end
end
